<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇游戏</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="game-container">
        <div class="game-header">
            <h1>🐍 贪吃蛇游戏</h1>
            <div class="score-board">
                <div class="score">分数: <span id="score">0</span></div>
                <div class="high-score">最高分: <span id="highScore">0</span></div>
            </div>
        </div>
        
        <div class="game-area">
            <canvas id="gameCanvas" width="400" height="400"></canvas>
            <div class="game-overlay" id="gameOverlay">
                <div class="overlay-content">
                    <h2 id="overlayTitle">游戏结束</h2>
                    <p id="overlayMessage">你的分数: <span id="finalScore">0</span></p>
                    <button id="restartBtn" class="btn">重新开始</button>
                </div>
            </div>
        </div>
        
        <div class="controls">
            <div class="control-info">
                <p>使用方向键或WASD控制蛇的移动，空格键开始/暂停游戏</p>
            </div>
            <div class="speed-control">
                <label for="speedSlider">游戏速度: <span id="speedValue">中等</span></label>
                <input type="range" id="speedSlider" min="1" max="5" value="3" class="speed-slider">
                <div class="speed-labels">
                    <span>慢</span>
                    <span>中等</span>
                    <span>快</span>
                </div>
            </div>
            <div class="control-buttons">
                <button id="startBtn" class="btn">开始游戏</button>
                <button id="pauseBtn" class="btn">暂停</button>
            </div>
        </div>
    </div>
    
    <script src="script.js"></script>
</body>
</html> 